package cn.nbt.busManage.model.vo;

import cn.nbt.busManage.model.dto.ScheduleDto;
import cn.nbt.busManage.model.entity.Bus;
import cn.nbt.busManage.model.entity.Driver;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;

@Data
public class ScheduleVo implements Serializable {
    private Integer id;
    private String start_time;
    private String end_time;

    public ScheduleVo(ScheduleDto schedulevDto){
        this.id = schedulevDto.getId();
        this.end_time=schedulevDto.getEndTime();
        this.start_time=schedulevDto.getStartTime();
    }

    @JsonCreator
    public ScheduleVo(@JsonProperty("id") Integer id,
                      @JsonProperty("start_time") String start_time,
                      @JsonProperty("end_time") String end_time) {
        this.id = id;
        this.start_time = start_time;
        this.end_time = end_time;
    }
}
